//
//  MBHomeItemView.m
//  MemberBusiness-ios
//
//  Created by cherry pu on 2018/4/23.
//  Copyright © 2018年 zhangXin. All rights reserved.
//

#import "MBHomeItemView.h"

@implementation MBHomeItemView

- (instancetype)init
{
    self = [super init];
    if (self) {
        UIImageView* iconImageView = [[UIImageView alloc]init];
        self.iconImageView = iconImageView;
        [self addSubview:iconImageView];
        
        [iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.size.mas_equalTo(CGSizeMake([UIView lf_sizeFromIphone6:45], [UIView lf_sizeFromIphone6:45]));
            make.centerY.equalTo(self);
            make.left.equalTo(self);
        }];
        
        UILabel* nameLabel = [[UILabel alloc]init];
        self.nameLabel = nameLabel;
        nameLabel.font = [UIFont lf_systemFontOfSize:12];
        nameLabel.textColor = [UIColor colorWithR:24 G:24 B:24];
        [self addSubview:nameLabel];
        
        [nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(iconImageView.mas_right).offset([UIView lf_sizeFromIphone6:13]);
            make.bottom.equalTo(iconImageView.mas_centerY).offset([UIView lf_sizeFromIphone6:-5]);
        }];

        UILabel* numLabel = [[UILabel alloc]init];
        self.numLabel = numLabel;
        numLabel.font = [UIFont lf_mediumFontOfSize:21];
        numLabel.textColor = [UIColor colorWithR:24 G:24 B:24];
        [self addSubview:numLabel];
        
        [numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(nameLabel);
            make.top.equalTo(iconImageView.mas_centerY).offset([UIView lf_sizeFromIphone6:5]);
        }];

    }
    return self;
}

@end
